package Day22;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        while (in.hasNextLine()) {

            String s = in.nextLine();
            char[] chars = s.toCharArray();

            List<Character> list = new ArrayList<>();
            List<Character> trash = new ArrayList<>();
            for (char aChar : chars) {
                if (list.contains(aChar)) {
                    list.remove(list.indexOf(aChar));
                    trash.add(aChar);
                } else if (!trash.contains(aChar)){
                    list.add(aChar);
                }
            }

            if (list.isEmpty()) {
                System.out.println(-1);
            } else {
                System.out.println(list.get(0));
            }
        }

    }

    public static void main0(String[] args) {

        Scanner in = new Scanner(System.in);

        while (in.hasNextInt()) {

            int n = in.nextInt();
            int c = in.nextInt();
            int[] bn = new int[n];
            for (int i = 0; i < n; i++) {
                bn[i] = in.nextInt();
            }

            for (int i = 0; i < n; i++) {
                if (c >= bn[i]) {
                    c += bn[i];
                } else {
                    c += maxYue(bn[i], c);
                }
            }

            System.out.println(c);
        }

    }

    public static int maxYue (int n ,int b) {
        int i = 1;

        int c = Math.min(n, b);
        for (int j = c; j > 0; j--) {
            if (b % j == 0 && n % j == 0) {
                return j;
            }
        }

        return i;
    }

}
